Processing of the disappearance of the (textarea) carriage return line break when a request (URL) is submitted, textarea carriage return line break
About the processing that the (textarea) carriage return line break disappears when the request (URL)
Php obtains the textarea value and processes the carriage return and line feed method. textarea returns the line feed. Php obtains the textarea value and processes the carriage return and line feed method. the example in this article describes how
PHP gets the value of textarea and handles the method of carriage return, textarea carriage return line
This example describes how PHP gets the value of the textarea and handles the carriage return line-wrapping method. Share to everyone for your
Today, I encountered a textarea line feed problem in the project, which was not solved after debugging for half a day. You need to convert the carriage return text in textarea into a br and store it in the database. The following is my solution to
Here is my solution to the problem, and finally I understand it, it's a sewer that almost capsized
1. You must know that the line break in TextArea is \ n (personal detection found that pressing ENTER is \ n, as if it were \ r \ n under Linux)
2.
When using textarea, there is a need to do a custom line, rather than through the textarea fixed width to automatically wrap, in fact, in the HTML can be directly through to line, but also think of \ n to achieve the line, the result is not bird
Today, I encountered a textarea line feed problem in the project, which was not solved after debugging for half a day. You need to convert the line breaks in textarea into and save them to the database.
The following is my solution to this
The PHP implementation splits the value of textarea into an array based on the carriage return line, textarea the carriage return.
This example describes how the PHP implementation splits the value of textarea into an array based on the carriage
After my test form textarea line break, in windows it is rn, in linux it is n (this is not tested), in addition, in win, r, n have a line break function.
After my test form textarea line break, in windows it is rn, in linux it is n (this is not
The following is my solution to this problem. At last, I fully understood it. It was a real risk of turning around the ship.
1.You must know that the linefeed in textarea is \ n (I found that the Enter key is \ n, as if it is \ r \ n in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.